import React from 'react'
import ReactDOM from 'react-dom'
import { createStore } from 'redux'
import { Provider} from 'react-redux'
import counter from './reducer/counter'
import App from './container/container.js'

// Store
const store = createStore(counter)

ReactDOM.render(
	<Provider store={store}>
	    <App />
	</Provider>,
	document.getElementById('root')
)
/*
React-Redux 提供Provider组件，可以让容器组件拿到state。
上面代码中，Provider在根组件外面包了一层，这样一来，App的所有子组件就默认都可以拿到state了。
*/